package cn.lyh.FoodSystem.Controller;

import cn.lyh.FoodSystem.Dto.Result;
import cn.lyh.FoodSystem.Entity.Status;
import cn.lyh.FoodSystem.Service.ImpI.StatusServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/status")
public class StatusController {

    private final StatusServiceImpl statusService;

    public StatusController(StatusServiceImpl statusService) {
        this.statusService = statusService;
    }

    /**
     * 新增字典状态
     * @param status
     * @return
     */
    @PostMapping("/addStatus")
    private Result addStatus(@RequestBody Status status){
        return statusService.addTabStatus(status);
    }

    /**
     * 查询字典状态
     */
    @PostMapping("/queryStatus")
    private Result queryStatus(@RequestBody Status status){
        return statusService.queryStatus(status);
    }


}
